import styled from 'styled-components'

export const Container = styled.div`
    position: relative;
    margin-bottom: 100px;
    @media (max-width: 1200px) {
        display: flex;
        justify-content: center;
    }
    .article-c{
        width: 830px;
        margin-right: 20px;
        display: inline-block;
        @media (max-width: 1200px) {
            width: 100%;
            margin: 0px;
        }
        .article{
            padding: 40px;
            @media (max-width: 1200px) {
                padding: 0 20px;
            }
            .title{
                font-size: 30px;
                color: ${props=>props.theme.detailTitleColor};
                font-weight: bold;
                padding: 20px 0;
                line-height: 1.5;
            }
            .desc{
                display: flex;
                justify-content: space-between;
                padding: 4px 20px 4px 4px;
                font-size: 14px;
                background-color: #f7f7f7;
                border-radius: 2px;
                margin-bottom: 16px;
            }
            .content{
                overflow: hidden;
                @media (max-width: 1200px) {
                    font-size: 14px;
                }
                color: ${props=>props.theme.detailTextColor};
                img{
                    width: 100%;
                    opacity: ${props=>props.theme.detailImgOpacity};
                }
                code{
                    color: #1890ff;
                    background-color: #f2f9ff;
                }
                pre code{
                    color: #24292e;
                    background-color: #fff;
                }
                a{
                    text-decoration: underline;
                }
                blockquote{
                    border-color: #1890ff;
                }
                h1, h2, h3, h4, h5, h6{
                    margin-top: 40px;
                    margin-bottom: 24px;
                    color: ${props=>props.theme.detailHColor};
                }
                h1, h2{
                    border-color: ${props=>props.theme.detailBorderColor};
                }
                table{
                    color: #24292e;
                    font-size: 14px;
                }
            }
            .footer{
                border-top: 1px solid ${props=>props.theme.detailBorderColor};
                margin: 20px 0;
                padding-top: 20px;
                .operate{
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
                    padding-right: 20px;
                    color: ${props=>props.theme.articleActionColor};
                }
                .page-change{
                    display: flex;
                    flex-direction: column;
                    align-items: flex-start;
                    p{
                        overflow: hidden;
                        cursor: pointer;
                        position: relative;
                        color: ${props=>props.theme.articleActionColor};
                        &::after{
                            content: '';
                            position: absolute;
                            bottom: 0;
                            left: -100%;
                            width: 100%;
                            height: 1px;
                            background-color: #1890ff;
                            transition: ease-in-out 0.3s;
                        }
                        &:hover{
                            color: #1890ff;
                            &::after{
                                left: 0;
                                transition: ease-in-out 0.3s;
                            }
                        }
                    }
                }
            }
        }
    }
    
    .anchor{
        width: calc(100% - 850px);
        float: right;
        position: sticky;
        top: 80px;
        @media (max-width: 1200px) {
            display: none;
        }
        .anchor-content{
            padding: 0 20px;
            margin: 20px 0;
            max-height: calc(100vh - 200px);
            overflow: hidden;
            .ant-anchor-wrapper{
                max-height: calc(100vh - 200px) !important;
                background-color: ${props=>props.theme.contentsBgColor};
                border-radius: 4px;
                .ant-anchor-link-active > .ant-anchor-link-title{
                    color: ${props=>props.theme.contentsActiveColor};
                }
                .ant-anchor-link-title{
                    color: ${props=>props.theme.contentsColor};
                    &:hover{
                        color: ${props=>props.theme.contentsActiveColor};
                    }
                    &:active{
                        color: ${props=>props.theme.contentsActiveColor};
                    }
                }
            }
        }
    }
`

export const LikeContainer = styled.div`
    @media (max-width: 768px) {
        right: 60px;
        bottom: 230px;
    }
    @media (max-width: 480px) {
        right: 20px;
        bottom: 230px;
    }
    position: fixed;
    bottom: 290px;
    right: 100px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: #fafafa;
    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    .like-badge{
        position: absolute;
        right: 0;
        top: -10px;
        transform: translateX(44%);
    }
`

export const CollectContainer = styled.div`
    @media (max-width: 768px) {
        right: 60px;
        bottom: 170px;
    }
    @media (max-width: 480px) {
        right: 20px;
        bottom: 170px;
    }
    position: fixed;
    bottom: 230px;
    right: 100px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: #fafafa;
    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
`